<?php
class PreciosForm extends sfForm
{
  public function configure()
  {
    $cantidades = array(1 => 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
    $this->setWidgets(array(
      'nombre'              => new sfWidgetFormInputText(),
      'pais'                => new sfWidgetFormInputText(),
      'email'               => new sfWidgetFormInputText(),
      'empresa'             => new sfWidgetFormInputText(),
      'telefono'            => new sfWidgetFormInputText(),
      'producto'            => new sfWidgetFormInputText(),
      'mensaje'            => new sfWidgetFormTextarea(array(),array('rows' => 10)),
    ));

    $this->setValidators(array(
      'nombre'              => new sfValidatorString(array('max_length' => 50, 'required' => true)),
      'pais'                => new sfValidatorString(array('max_length' => 50, 'required' => true)),
      'email'               => new sfValidatorString(array('max_length' => 150, 'required' => true)),
      'empresa'             => new sfValidatorString(array('max_length' => 150, 'required' => true)),
      'telefono'            => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'producto'            => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'mensaje'            => new sfValidatorString(array('required' => true)),
    ));
    
    $this->widgetSchema->setLabels(array(
      'nombre'    => ' ',
      'pais'   => ' ',
      'email'   => ' ',
      'empresa'   => ' ',
      'telefono'   => ' ',
      'producto'   => ' ',
      'mensaje' => ' ',
    ));
    $this->widgetSchema->setNameFormat('precios[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->widgetSchema->setFormFormatterName('list');

    parent::setup();
  }
}
